package com.zmn.oms.model.entity.chan;

import com.alibaba.fastjson.annotation.JSONField;
import com.zmn.oms.manager.utils.MongodbConsts;
import lombok.Data;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 类描述：渠道门户消息记录
 *
 * @author lhl
 * @date 2020/12/29 21:50
 */
@Data
@Document(collection = MongodbConsts.CHAN_FACADE_MESSAGE_TABLE)
public class FacadeMessageDoc {
    /**
     * 订单线索ID
     */
    @Indexed
    private Long clueId;

    /**
     * 渠道门户ID
     */
    @Indexed
    private Integer facadeId;

    /**
     * 渠道推过来的消息的编号
     */
    private Integer messageNo;

    /**
     * 对应FacadeMessageEvent.tag
     */
    private String eventTag;

    /**
     * 对应FacadeMessageEvent.fun
     */
    private String eventFun;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 录入时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
